package web.member;

import com.google.gson.Gson;
import entity.MemberBean;
import services.MemberServices;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/renew")
public class Renew extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType("application/json");
        int renews = Integer.parseInt(req.getParameter("renews"));
        int member_id = Integer.parseInt(req.getParameter("member_id"));
        int n = new MemberServices().renew(renews, member_id);
        resp.getWriter().println(n > 0 ? "续费成功" : "续费失败");
    }
}
